package com.bestcem.xm.txtanls.controller.param.chart;

import com.bestcem.xm.txtanls.grpc.service.param.chart.BaseChartParam;
import com.bestcem.xm.txtanls.grpc.service.param.chart.TopicRelationParam;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import java.time.LocalDate;

/**
 * 话题关联参数
 * @author jy.zhao
 * @version 2.0
 * @date 2021/8/5 18:08
 **/
@Getter
@Setter
public class TopicRelationQuery extends BaseChartQuery {

    @ApiModelProperty(value = "话题id")
    @JsonProperty(value = "topics_id")
    private String topicId;

    public TopicRelationParam getTopicRelationParam() {
        BaseChartParam baseChartParam = super.getBaseChartParam();
        TopicRelationParam topicRelationParam = new TopicRelationParam();
        BeanUtils.copyProperties(baseChartParam, topicRelationParam);
        topicRelationParam.setTopicId(topicId);
        return topicRelationParam;
    }

    public TopicRelationQuery(String projectId, String fieldId, String filterType, String current, LocalDate startTime, LocalDate endTime, String topicId) {
        super(projectId, fieldId, filterType, current, startTime, endTime);
        this.topicId = topicId;
    }
}
